package cn.signalpha.modules.shop.dto;

import cn.signalpha.core.swagger.ApiModelPropertyEnum;
import cn.signalpha.modules.shop.entity.enums.LogisticsTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 数据传输对象实体类
 *
 * @author suguangjun
 */
@Data
public class OrderConfirmDTO implements Serializable {
	private static final long serialVersionUID = 1L;

	@NotNull
	@ApiModelProperty(value = "地址ID，0为默认地址")
	private Long addrId;

	@ApiModelProperty(value = "购物车id 数组")
	private List<Long> cartIds;

    @ApiModelProperty(value = "立即购买时提交的商品项")
    private CartDTO.SaveDTO orderItem;

	@ApiModelProperty(value = "每个商户选择信息")
	private List<OrderShopDTO> orderShopList;

	@ApiModelProperty(value = "优惠券id")
	private Long couponId;

	@ApiModelProperty(value = "余额抵扣数量")
	private Double deductMoney;

	@ApiModelProperty(value = "积分抵扣数量")
	private Double deductIntegral;

	@Data
	@ApiModel(value= "每个商户选择信息")
	public static class OrderShopDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@ApiModelProperty(value = "商户id", required = true)
		private Long sellerId;
		@ApiModelProperty(value = "优惠券id")
		private Long couponId;
		@ApiModelProperty(value = "配送方式")
		@ApiModelPropertyEnum(LogisticsTypeEnum.class)
		private Integer logisticsType;
	}
}
